#include "Thread.hpp"
#include <iostream>
#include <unistd.h>
using namespace std;

using func_t = std::function<void(const std::string)>;

void Print(const std::string &name)
{
    while (1)
    {
        std::cout << name << " is ranning" << endl;
        sleep(1);
    }
}

int main()
{
    ThreadMoudle::Thread t("th1", Print);
    t.Start();
    cout << "status :" << t.Status() << endl;
    sleep(5);
    t.Stop();
    cout << "status :" << t.Status() << endl;

    sleep(1);
    t.Join();
    cout << "status :" << "joined" << endl;


    return 0;
}